package cn.iocoder.yudao.module.engine.model.websoket;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.Instant;
import java.util.List;

@Data
public class EngineInputDataVO {
    @JsonIgnore
    private final Instant websocketStart = Instant.now();

    @Schema(description = "ttsName")
    private String ttsName;

    @Schema(description = "音频文本")
    private EngineInputDataVO.AudioText audioText;

    @Schema(description = "传感器")
    private List<EngineInputDataVO.Sensor> sensors;

    @Data
    public static class AudioText {
        @Schema(description = "音频文本", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotEmpty
        private String text;
    }

    @Data
    public static class Sensor {
        /**
         * 传感器类型，SensorTypeEnum
         */
        @Schema(description = "传感器", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull
        private String sensorType;

        @Schema(description = "开启次数")
        private Integer upCount;

        @Schema(description = "X轴数据", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull
        private Integer xAxis;

        @Schema(description = "Y轴数据", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull
        private Integer yAxis;

        @Schema(description = "Z轴数据", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull
        private Integer zAxis;

//        @Schema(description = "检测周期, 单位秒", requiredMode = Schema.RequiredMode.REQUIRED)
//        @NotNull
//        private Integer detectionPeriod;
    }

}
